9<template>
  <div class="dashboard-container">
    <div class="app-container">
      <el-card shadow="never">
        <!-- 目录管理 -->
        <!-- <directorysL></directorysL> -->
        <el-form>
          <div>
        <el-row type="flex" :gutter="24">
        <el-col :span="12">
                  <el-form-item label-width="80px" label="目录名称">
                    <el-input size="small"></el-input>
                  </el-form-item>
        </el-col>
        <el-col :span="12">
                  <el-form-item label-width="80px" label="状态">
                    <el-input size="small"></el-input>
                  </el-form-item>
        </el-col>
        <el-col>
                    <el-button size="small">清除</el-button>
                    <el-button size="small" type="primary">搜索</el-button>
        </el-col>
        <el-row type="flex" justify="end">
        <el-col>
                    <el-button size="small" class="el-icon-edit" type="success">新增目录</el-button>
        </el-col>
        </el-row>
        </el-row>
        <div class="shuju">
          <el-button type="text" disabled class="el-icon-info">数据一共 {{pagesize}}条 </el-button>
          </div>
        </div>
        </el-form >
        <el-table :data="list1" style="width: 100%">
          <el-table-column  prop="id" label="编号"></el-table-column>
          <el-table-column width="178px" prop="subjectName" label="所属学科" ></el-table-column>
          <el-table-column width="174px" prop="directoryName" label="目录名称"> </el-table-column>
          <el-table-column width="174px" prop="username" label="创建者"> </el-table-column>
          <el-table-column width="174px" prop="addDate" label="创建日期">
            <template v-slot="{row}">
              <span>{{$moment(row.addDate).format("YYYY-MM-DD HH:MM:SS")}}</span>
            </template>
          </el-table-column>
          <el-table-column width="174px" prop="totals" label="面试题数量"> </el-table-column>
          <el-table-column width="174px" prop="state" label="状态">
            <template v-slot="{row}">
              <span>{{row.state===0?"禁用" :"启用"}} </span>
            </template>
          </el-table-column>
          <el-table-column width="150px" label="操作" >
            <el-button type="text">启用</el-button>
            <el-button type="text">修改</el-button>
            <el-button type="text">删除</el-button>
             </el-table-column>
        </el-table>
      </el-card>
    </div>
  </div>
</template>

<script>
import { list as getCompanys } from '@/api/hmmm/companys'
import { list as getQuestion } from '@/api/hmmm/questions'
import { list as list1 } from '../../api/hmmm/directorys'
// import directorysL from './companys/QuesTionsl.vue'
export default {
  components: {
    // directorysL
  },
  data () {
    return {
      pagesize: '10',
      page: 1,
      totals: '',
      state: '',
      list1: []
    }
  },
  async created () {
    getCompanys()
    getQuestion()
    await this.mululist()
  },
  methods: {
    //  获取  目录列表
    async mululist () {
      const res = await list1({ pagesize: 10, page: 1 })
      this.list1 = res.data.items
      console.log(res.data.items.state)
      // if(state)
      // console.log(res)
    }
  }
}
</script>

<style scoped>
.shuju{
  background-color: #f4f4f5;
  height: 30px;
  display: flex;
  align-content: center !important;
  line-height: 30px;
  border-left: 1px ;
  font-size: 10px;
}
</style>
